package com.example.smart_campus.pojo.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Table;

import java.io.Serializable;

/**
 * <p>
 * 校园卡表，存储学生的校园卡信息
 * </p>
 *
 * @author liyv
 * @since 2024-10-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("campus_cards")
public class CampusCards implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 校园卡ID，主键
     */
    @TableId(value = "card_id", type = IdType.AUTO)
    private Integer cardId;

    /**
     * 学生ID，外键
     */
    private Integer studentId;

    /**
     * 校园卡余额
     */
    private BigDecimal balance;


    public Integer getCardId() {
        return cardId;
    }

    public void setCardId(Integer cardId) {
        this.cardId = cardId;
    }

    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    @Override
    public String toString() {
        return "CampusCards{" +
        "cardId=" + cardId +
        ", studentId=" + studentId +
        ", balance=" + balance +
        "}";
    }
}
